home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK2.toast / Development Kits (Disc 2) / QuickDraw GX / Programming Stuff / Sample Code / Printing Samples / Extensions… / Spooling ƒ / About Spooling… next >
Encoding:
Text File  |  1995-04-10  |  3.5 KB  |  42 lines  |  [ttro/ttxt]

  1. About Spooling…
  2.  
  3. "Spooling" is a printing extension which installs a panel in the print dialog and allows you to select a directory to re-route your spool files to during printing.  Once selected, an alias to the directory is stored in a preferences file.  Thereafter, (until you go back to the panel and change things or your alias breaks), all spool files will be placed in the specified directory during printing.  QuickDraw GX maintains an alias to the relocated spool file, so printing proceeds as usual.
  4.  
  5. Why would you want to do such a thing?  Well, I can think of at least two reasons:
  6.  
  7. • If your boot drive doesn't have much space available, you can store your spool files on an alternate storage device (another SCSI drive, or perhaps a server) instead.  This way, only a 2K print file alias will be stored in the boot drive's PrintMonitor Documents folder for each job.  The rest gets off-loaded to the storage device of your choice.  Pretty cool.
  8.  
  9. or
  10.  
  11. • If you just want to annoy your coworkers by randomly spooling print files to their systems during printing.
  12.  
  13.  
  14. As mentioned above, the folder you spool to can reside on a remote Macintosh.  If you choose this approach, make sure that you have read *and* write access to the folder you select.  If, for example, you select a write-only drop box, GX will not be able to get at the spool files once it writes them into the folder.  (I'll add a check for access privileges in a future version.)
  15.  
  16. The printing extension uses the Alias Manager to locate and mount remote servers, in the following way:
  17.  
  18. When the Print… panel is invoked by an application, the printing extension does a "quick check" to verify that the alias to the last chosen spool folder is current.  It will not mount remote volumes during this check, because it's just too annoying.  So, if you're spooling to a remote server, the alias will not be validated at this point.  However, if you're using a folder on a local volume, the alias will be validated.
  19.  
  20. When the "Print" button is pressed in the Print dialog, any changes you've made are saved.  At the same time, the alias to the folder you've selected is validated, to make sure that no one has changed things behind your back.
  21.  
  22. When the GXCreateSpoolFile message is intercepted, a full (ResolveAlias) validation is performed on the alias before using it to redirect the spool file.  Since you'd have to mount any remote volumes at this time anyway, this seemed to be a good approach.
  23.  
  24. At any of the times above, the spool folder alias stored by the extension is updated, if need be.
  25.  
  26. If the folder's alias cannot be resolved at GXCreateSpoolFile time, (or if a preferences file doesn't exist yet), spool files are not redirected.  In this case, printing proceeds just as if the extension was turned off.
  27.  
  28. This extension shows a number of things:
  29.  
  30. • How to write an extension which installs a panel, handles panel events and uses the way-cool ‘xdtl’ resources.
  31.  
  32. • How to redirect spool files during printing.
  33.  
  34. • How to use global data within a printing extension.
  35.  
  36. • An alternate approach to storing data for printing extensions.  Since the settings (on/off) and the current folder alias are retrieved from a preferences file, rather than a collection item, the printing extension can always read and use this information once it's set up.  Even if the user doesn't go through the print panels, the printing extension can retrieve "system-wide" info about where to put the spool files, or if it should do anything at all.
  37.  
  38. Dave Hersey
  39. Apple Developer Technical Support
  40.  
  41. 7/14/94
  42. v1.0